#!/bin/bash -e

function info() {
echo Usage: `basename $0` 'in.vcf filter_expression filter_name'
exit 65
}

while getopts ":p:l:" opts
do
case $opts in
	l) interval=$OPTARG;;
	p) out_prefix=$OPTARG;;
	\?) info;;
esac
done
shift $(($OPTIND - 1))

test $# -lt 3 && info


. $var

echo gatk VariantFiltration $3
java $j_mem -jar $gatk -R $ref_genome -T VariantFiltration -o $out_prefix.filter.vcf -L $interval --variant $1 --filterExpression "$2" --filterName "$3"

. $cmd_done